package org.fujene.structure;

import org.fujene.communicate.hash.VirtualContentHash;

// 内部データ 転置インデックス
public final class InvertIndexData{
	private LookupPointer prevPtr;
	private LookupPointer contentPtr;
	private long ID;
	private int termfreq;

	public InvertIndexData(LookupPointer prevPtr, long ID, int termfreq){
		this.prevPtr = prevPtr;
		this.ID = ID;
		this.termfreq = termfreq;
	}

	public InvertIndexData(LookupPointer prevPtr, LookupPointer contentPtr, int termfreq){
		this.prevPtr = prevPtr;
		this.contentPtr = contentPtr;
		this.termfreq = termfreq;
	}

	public LookupPointer getPrevPtr(){
		return prevPtr;
	}

	public LookupPointer getContentPtr(){
		return contentPtr;
	}

	public long getID(){
		return ID;
	}

	public int getTermfreq(){
		return termfreq;
	}

	public HashID getHashID(){
		return new HashID(VirtualContentHash.getContentHash(ID), ID);
	}
}